/*
 * TelaCadAgencia
 * 
 * Versão 1.0
 * 
 * Data de criação: 27/05/2013
 * 
 * Copyright (c)
 * Autor: Odair José Tanes
 * Matrícula: 2009209186
 * Disciplina: Projeto de Sistemas de Software
 * 
 * Protótipo criado para exercício da disciplina
 * 
 */

package edu.ufes.pss.exercicioSwingBanco.view;

import javax.swing.JOptionPane;

/**
 * Tela para cadastro de agência
 *
 * @author OdairJT
 */

public class CrudAgenciaView extends javax.swing.JFrame {

    /**
     * Creates new form TelaCadAgencia
     */
    public CrudAgenciaView() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlBarraBotoes = new javax.swing.JPanel();
        btnSalvar = new javax.swing.JButton();
        btnFechar = new javax.swing.JButton();
        btnEditar = new javax.swing.JButton();
        btnExcluir = new javax.swing.JButton();
        cmbEstado = new javax.swing.JComboBox();
        lblEstado = new javax.swing.JLabel();
        lblCidade = new javax.swing.JLabel();
        lblCodigo = new javax.swing.JLabel();
        txtCodigo = new javax.swing.JTextField();
        txtCidade = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("MANTER AGÊNCIAS");
        setResizable(false);

        pnlBarraBotoes.setBackground(new java.awt.Color(204, 204, 204));

        btnSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edu/ufes/pss/exercicioSwingBanco/image/SaveImagem.gif"))); // NOI18N
        btnSalvar.setText("Salvar");

        btnFechar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edu/ufes/pss/exercicioSwingBanco/image/CancelImagem.gif"))); // NOI18N
        btnFechar.setText("Fechar");

        btnEditar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edu/ufes/pss/exercicioSwingBanco/image/EditImagem.png"))); // NOI18N
        btnEditar.setText("Editar");
        btnEditar.setEnabled(false);

        btnExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edu/ufes/pss/exercicioSwingBanco/image/DeleteImagem.gif"))); // NOI18N
        btnExcluir.setText("Excluir");
        btnExcluir.setEnabled(false);

        org.jdesktop.layout.GroupLayout pnlBarraBotoesLayout = new org.jdesktop.layout.GroupLayout(pnlBarraBotoes);
        pnlBarraBotoes.setLayout(pnlBarraBotoesLayout);
        pnlBarraBotoesLayout.setHorizontalGroup(
            pnlBarraBotoesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, pnlBarraBotoesLayout.createSequentialGroup()
                .addContainerGap(131, Short.MAX_VALUE)
                .add(btnSalvar)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(btnEditar)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(btnExcluir)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(btnFechar)
                .addContainerGap())
        );
        pnlBarraBotoesLayout.setVerticalGroup(
            pnlBarraBotoesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pnlBarraBotoesLayout.createSequentialGroup()
                .addContainerGap()
                .add(pnlBarraBotoesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(btnSalvar)
                    .add(btnFechar)
                    .add(btnEditar)
                    .add(btnExcluir))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        cmbEstado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { " ", "AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PR", "PB", "PA", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SE", "SP", "TO" }));

        lblEstado.setText("Estado");

        lblCidade.setText("Cidade");

        lblCodigo.setText("Código");

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(lblCodigo)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, lblEstado))
                .add(18, 18, 18)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(txtCodigo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 81, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(lblCidade)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(txtCidade))
                    .add(cmbEstado, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
            .add(pnlBarraBotoes, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(0, 6, Short.MAX_VALUE)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                        .add(lblCodigo)
                        .add(txtCodigo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(lblCidade))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, txtCidade, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(cmbEstado, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(lblEstado))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(pnlBarraBotoes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnEditar;
    private javax.swing.JButton btnExcluir;
    private javax.swing.JButton btnFechar;
    private javax.swing.JButton btnSalvar;
    private javax.swing.JComboBox cmbEstado;
    private javax.swing.JLabel lblCidade;
    private javax.swing.JLabel lblCodigo;
    private javax.swing.JLabel lblEstado;
    private javax.swing.JPanel pnlBarraBotoes;
    private javax.swing.JTextField txtCidade;
    private javax.swing.JTextField txtCodigo;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the btnFechar
     */
    public javax.swing.JButton getBtnFechar() {
        return btnFechar;
    }    

    /**
     * @return the btnEditar
     */
    public javax.swing.JButton getBtnEditar() {
        return btnEditar;
    }

    /**
     * @return the btnExcluir
     */
    public javax.swing.JButton getBtnExcluir() {
        return btnExcluir;
    }

    /**
     * @return the btnSalvar
     */
    public javax.swing.JButton getBtnSalvar() {
        return btnSalvar;
    }

    /**
     * @return the cmbEstado
     */
    public javax.swing.JComboBox getCmbEstado() {
        return cmbEstado;
    }

    /**
     * @return the txtCidade
     */
    public javax.swing.JTextField getTxtCidade() {
        return txtCidade;
    }

    /**
     * @return the txtCodigo
     */
    public javax.swing.JTextField getTxtCodigo() {
        return txtCodigo;
    }
    
    public void showMessage(String pMessage){
        JOptionPane.showMessageDialog(this, pMessage);
    }
    
    public int showConfirmMessage(String pTitulo, String pMessage){
        return JOptionPane.showConfirmDialog(this, pMessage, pTitulo, JOptionPane.YES_NO_OPTION);
    }
}
